package com.vegetable.modules.entity.outbound;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 销售订单走货对照库存表
 * </p>
 *
 * @author wangruijie
 * @since 2024-03-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="SalesOrderDetailStock对象", description="销售订单走货对照库存表")
public class SalesOrderDetailStock implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "销售订单id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orderId;

    @ApiModelProperty(value = "商品明细id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long detailId;

    @ApiModelProperty(value = "库存id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long stockId;

    @ApiModelProperty(value = "数量")
    private Integer number;

    @ApiModelProperty(value = "重量")
    private BigDecimal weight;

    @ApiModelProperty(value = "蔬菜成本")
    @TableField(exist = false)
    private BigDecimal costWeight = BigDecimal.ZERO;

    @ApiModelProperty(value = "包装成本")
    @TableField(exist = false)
    private Double packageCostToShow = 0d;

    @TableField(exist = false)
    private String agentName;

    @TableField(exist = false)
    private String stockBatchNo;

    @TableField(exist = false)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long stockOrderId;

    @TableField(exist = false)
    @ApiModelProperty(value = "订单时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date orderTime;

    // 订单类型：0销售 1调拨 2加工
    private Integer type;


}
